import {create} from 'zustand'
import chatRoomMp3 from "@src/assets/chatRoom.mp3"
import informationCueMp3 from "@src/assets/informationCue.mp3"
import messageAlert from "@src/assets/messageAlert.mp3"

interface messageAudioCreateType {
    //进入 房间 音频
    chatRoomAudio: HTMLAudioElement;
    //消息提示音频
    informationCueAudio: HTMLAudioElement;
    //私信提示
    messageAlertAudio: HTMLAudioElement;
}

const chat_room_audio = new Audio()
chat_room_audio.src = chatRoomMp3
chat_room_audio.load(); // 加载音频
const information_cue_audio = new Audio()
information_cue_audio.src = informationCueMp3
information_cue_audio.load(); // 加载音频
const message_alert_audio = new Audio()
message_alert_audio.src = messageAlert
message_alert_audio.load(); // 加载音频
export const messageAudioCreate = create<messageAudioCreateType>(() => ({
    chatRoomAudio: chat_room_audio,
    informationCueAudio: information_cue_audio,
    messageAlertAudio: message_alert_audio,
}))
